#define _CRT_SECURE_NO_WARNINGS 1
#include"SList.h"
int main()
{
	SLTNode* plist = NULL;
	//头插5 4 3 2 1 0 -1
	printf("头插5 4 3 2 1 0 -1\n");
	SLTPushFront(&plist, 5);
	SLTPushFront(&plist, 4);
	SLTPushFront(&plist, 3);
	SLTPushFront(&plist, 2);
	SLTPushFront(&plist, 1);
	SLTPushFront(&plist, 0);
	SLTPushFront(&plist, -1);
	SLTPrint(plist);
	printf("\n");
	//在5之后插入6
	printf("用SLTInsertAfter函数在5之后插入6\n");
	SLTNode* pos = SLTFind(plist, 5);
	SLTInsertAfter(pos, 6);
	SLTPrint(plist);
	printf("\n");
	//在6之后插入7
	printf("用SLTInsertAfter函数在6之后插入71\n");
	pos = SLTFind(plist, 6);
	SLTInsertAfter(pos, 7);
	SLTPrint(plist);
	printf("\n");
	//在7之后尾插8 9 10 11 12
	printf("在7之后尾插8 9 10 11 12\n");
	SLTPushBack(&plist, 8);
	SLTPushBack(&plist, 9);
	SLTPushBack(&plist, 10);
	SLTPushBack(&plist, 11);
	SLTPushBack(&plist, 12);
	SLTPrint(plist);
	printf("\n");
	//头删掉-1
	printf("头删掉-1\n");
	SLTPopFront(&plist);
	SLTPrint(plist);
	printf("\n");
	//尾删掉12
	printf("尾删掉12\n");
	SLTPopBack(&plist);
	SLTPrint(plist);
	printf("\n");
	//在11前插入一个100
	printf("用SLTInsert函数在11前插入一个100\n");
	pos = SLTFind(plist, 11);
	SLTInsert(&plist, pos, 100);
	SLTPrint(plist);
	printf("\n");
	//删除100这个节点
	printf("用SLTErase函数删除100这个节点\n");
	pos = SLTFind(plist, 100);
	SLTErase(&plist, pos);
	SLTPrint(plist);
	printf("\n");
	//删除10的下一个节点
	printf("用SLTEraseAfter函数删除10的下一个节点\n");
	pos = SLTFind(plist, 10);
	SLTEraseAfter(pos);
	SLTPrint(plist);
	printf("\n");









	return 0;
}